#define _CRT_SECURE_NO_WARNINGS 1
void darr_store(darr_t* arr, const char* path)
{
    FILE* fp = fopen(path, "w");
    assert(fp);
    fwrite(arr->data, arr->size, arr->count, fp);
    fclose(fp);

}

darr_t* darr_load(int size, const char* path)
{
    FILE* fp = fopen(path, "r");
    assert(fp);
    darr_t* tmp = init(size);
    int res = 0;
    char buff[1024] = {};

    while (1)
    {
        int res = fread(buff, size, 1, fp);
        if (res == 0)
        {
            break;
        }
        push_back(tmp, buff);
        memset(buff, 0, sizeof(buff));
    }

    fclose(fp);
    return tmp;
}
